package ydj.cloud.example.nacosdiscoveryproviderexample.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class SessionAspect {

    /**
     * 定义一个切面的切入点
     */
    @Pointcut(value = "within(com.springcloud.alibaba.nacosdiscoveryproviderexample.controller..*)")
    public void test() {
        System.out.println("aspect test");
    }

    @Before(value = "test()")
    public void beforeAdvice() {
        System.out.println("我在连接点方法执行前执行...");
    }

}
